package com.demo.model;

import com.demo.view.CardsView;

import java.awt.*;

public class Card {
    private int row;
    private int column;
    private int number;
    private int x = -100;
    private int y = -100;
    private int width;
    private int height;
    public boolean newCard;

    private Color color;

    public Card(int row, int column, int number) {
        height = width = CardsView.edge;
        this.row = row;
        this.column = column;
        this.number = number;
        this.color = Theme.getCardColor(number);
        newCard = true;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public int getRow() {
        return row;
    }

    public int getColumn() {
        return column;
    }

    public int getNumber() {
        return number;
    }

    public Color getColor() {
        return color;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public void setColumn(int column) {
        this.column = column;
    }

    public void setNumber(int number) {
        this.number = number;
        setColor(Theme.getCardColor(number));
    }

    public void setColor(Color color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "Card{" +
                "row=" + row +
                ", column=" + column +
                ", number=" + number +
                '}';
    }
}
